﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace WebApi.Models
{
    [Serializable]
    public class UserInfoModel
    {
        public int userId;
        public string openid=string.Empty;
        public string userName = string.Empty;
        public string mobile = string.Empty;
        public string headUrl = string.Empty;//头像
        public int sex;
        public int isFristLogin;

        public static UserInfoModel GetUserInfo(DataRow dr)
        {
            UserInfoModel userinfo = new UserInfoModel();
            userinfo.userId = Convert.ToInt32(dr["uid"]);
            userinfo.openid = Convert.ToString(dr["openid"]).Trim();
            //userinfo.session_key = Convert.ToString(dr["session_key"]);
            userinfo.userName = Convert.ToString(dr["userName"]);
            userinfo.mobile = Convert.ToString(dr["mobile"]);
            userinfo.sex = Convert.ToInt32(dr["sex"]);
            userinfo.headUrl = Convert.ToString(dr["headUrl"]).Trim();
            return userinfo;
        }
    }
}